﻿using System.ServiceModel;
using XchangeStreamer.Utilities;

namespace XchangeStreamer.Core.Subscriber
{
    [ServiceContract(Name = "ISubscriber", CallbackContract = typeof(INotification), SessionMode = SessionMode.Required, Namespace = Settings.Namespace)]
    public interface ISubscriber
    {
        [OperationContract(IsOneWay = false, IsInitiating = true, Name = "Connect", Action = "Connect")]
        void Connect();

        [OperationContract(IsOneWay = true, Name = "Subscribe", Action = "Subscribe")]
        void Subscribe(int topicId);

        [OperationContract(IsOneWay = true, Name = "Unsubscribe", Action = "Unsubscribe")]
        void Unsubscribe(int topicId);

        [OperationContract(IsOneWay = false, IsTerminating = true, Name = "Disconnect", Action = "Disconnect")]
        void Disconnect();
    }
}
